import { reactive, ref, watch, toRefs, onMounted } from "@vue/composition-api";
import { GetCategory } from "../../api/article";

export default function useCategory() {
  const data = reactive({
    category: []
  });

  onMounted(() => {
    GetCategory({})
      .then(data => {
        data.category = data;
      })
      .catch(error => {});
  });

  return toRefs(data);
}
